﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLayer.Model.Repositories.Abstract;
using DataAccess.Repositories;

public partial class News : System.Web.UI.Page
{
    INewsRepository _newsRepository = new NewsRepository();

    protected void Page_Load(object sender, EventArgs e)
    {
        BindDataList();
    }

    private void BindDataList()
    {
        dlNews.DataSource = _newsRepository.FetchAll().OrderByDescending(n => n.Date);
        dlNews.DataBind();
    }
}
